<?php

class Exts_Application_Resource_LayoutConfig extends Zend_Application_Resource_ResourceAbstract
{
    public function init()
    {

        $bootstrap = $this->getBootstrap();
        $bootstrap->bootstrap('layout');
        $layout = $bootstrap->layout;
        $options = $this->getOptions();

        if ( isset( $options['styles'] ) ) {
            foreach( $options['styles']  as $style ){
                $layout->getView()->headLink()->appendStylesheet( $style );
            }
        }

        if ( isset( $options['scripts'] ) ) {
            foreach( $options['scripts'] as $script ){
                $layout->getView()->headScript()->appendFile( $script );
            }
        }

        if ( isset( $options['title'] ) ) {
            $layout->getView()->headTitle( $options['title'] );
        }
        return $layout;

    }
}
